package com.gitee.liang521.generate.common.exception;

import com.gitee.liang521.generate.common.api.IErrorCode;

/**
 * @author liang zai
 * @date 2021/9/16 14:04
 * @description 自定义api异常
 */
public class ApiException extends RuntimeException{

    private IErrorCode errorCode;

    public ApiException(IErrorCode errorCode){
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public ApiException(String message){
        super(message);
    }

    public ApiException(Throwable throwable) {
        super(throwable);
    }

    public ApiException(String message, Throwable throwable){
        super(message, throwable);
    }

    public IErrorCode getErrorCode(){
        return errorCode;
    }






















}
